/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Nihongo
 * Copyright (C) Massimiliano Maniscalco 2011, 2012 <massi.neptune@yahoo.com>
 * 
 * Nihongo is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Nihongo is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _RESULTCONTROLLER_H_
#define _RESULTCONTROLLER_H_
#include <gtkmm.h>
#include <iostream>

using namespace std;

class ResultController
{
public:
	inline ResultController ( Glib::RefPtr<Gtk::Builder> _bldr );
	inline ~ResultController () {};
	inline void set_modo ( char val ) { _modo = val > 3 ? 3 : val; }
	virtual bool present_window ( void ) = 0;
	typedef sigc::signal<void> Type_signal_window_closed;
	Type_signal_window_closed signal_window_closed ( void );

protected:
	Gtk::Window *_resultWin;
	Gtk::TreeView* _resultList;
	char _modo;
	
	inline ResultController () {}
	void init_result_controller ( Glib::RefPtr<Gtk::Builder> _bldr );
	void connect_signals ( void );
	virtual unsigned int load_item_in_tree_view ( void ) = 0;
	void on_close_button_clicked ( void );

private:
	Gtk::Button *_closeButton;
	Type_signal_window_closed window_closed;

};

#endif // _RESULTCONTROLLER_H_
